package algorithm;

import java.util.HashMap;
import java.util.Map;

public class Personalinfor_completion {
	public static final int  fullpoint = 100;
	public Map<String, Double> Get_completion(double now_percent,double past_percent){
		Map<String,Double> map = new HashMap<String,Double>();
		double flag;   //积分是否变化的标识符
		//数据检查
		if(now_percent < past_percent)
			now_percent = past_percent;
		else if(now_percent < 0)
			now_percent = 0;
		
		double temp = (now_percent - past_percent) * fullpoint;
		if(temp < 1){
			flag = 0;   //积分改变
			temp = 0;
		}
		else{
			flag = 1;   //积分未改变
		}
		map.put("flag", flag);  //标识符
		map.put("point", temp); //应得积分
		map.put("percentage", now_percent);  //现在的信息完善度
		return map;
	}
}
